﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace XmlStudio.Resources.UserControls {
    /// <summary>
    /// Interaction logic for YesNoCancelButtons.xaml
    /// </summary>
    public partial class YesNoCancelButtons : UserControl {
        public YesNoCancelButtons() {
            InitializeComponent();
        }

        public event EventHandler<RoutedEventArgs> YesClicked;
        public event EventHandler<RoutedEventArgs> NoClicked;
        public event EventHandler<RoutedEventArgs> CancelClicked;

        private void OnYesClicked(RoutedEventArgs e) {
            var yesClicked = this.YesClicked;
            if(yesClicked != null) {
                yesClicked(this, e);
            }
        }

        private void OnNoClicked(RoutedEventArgs e) {
            var noClicked = this.NoClicked;
            if(noClicked != null) {
                noClicked(this, e);
            }
        }

        private void OnCancelClicked(RoutedEventArgs e) {
            var cancelClicked = this.CancelClicked;
            if(cancelClicked != null) {
                cancelClicked(this, e);
            }
        }

        private void YesButtonClicked(object sender, RoutedEventArgs e) {
            this.OnYesClicked(e);
        }

        private void NoButtonClicked(object sender, RoutedEventArgs e) {
            this.OnNoClicked(e);
        }

        private void CancelButtonClicked(object sender, RoutedEventArgs e) {
            this.OnCancelClicked(e);
        }
    }
}